---
layout: m1x_soap
title: Set For Quote Product
---

<h3><a name="giftmessage.setForQuoteProduct-Module%3AGiftMessageAPI"></a>Module: GiftMessage API</h3>

<h4><a name="giftmessage.setForQuoteProduct-Resource%3Agiftmessage"></a>Resource: giftmessage</h4>

<h5><a name="giftmessage.setForQuoteProduct-Method%3A"></a>Method:</h5>

<ul>
	<li>giftmessage.setForQuoteProduct (SOAP V1)</li>
	<li>giftMessageSetForQuoteProduct (SOAP V2)</li>
</ul>


<p>Allows you to set a gift message for a product in the shopping cart (quote).</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> quoteId </td>
<td> Shopping cart ID (quote ID) </td>
</tr>
<tr>
<td> array </td>
<td> productsAndMessages <br class="atl-forced-newline" /> </td>
<td> Array of giftMessageAssociativeProductsEntity </td>
</tr>
<tr>
<td> string </td>
<td> store </td>
<td> Store view ID or code (optional) </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> array </td>
<td> result </td>
<td> Array of giftMessageResponse </td>
</tr>
</tbody></table>


<p>The <b>giftMessageAssociativeProductsEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> array </td>
<td> product </td>
<td> Array of shoppingCartProductEntity </td>
</tr>
<tr>
<td> array </td>
<td> message <br class="atl-forced-newline" /> </td>
<td> Array of giftMessageEntity </td>
</tr>
</tbody></table>


<p>The <b>giftMessageResponse</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> entityId <br class="atl-forced-newline" /> </td>
<td> Entity ID </td>
</tr>
<tr>
<td> boolean </td>
<td> result <br class="atl-forced-newline" /> </td>
<td> Result </td>
</tr>
<tr>
<td> string </td>
<td> error <br class="atl-forced-newline" /> </td>
<td> Error </td>
</tr>
</tbody></table>


<p>The <b>shoppingCartProductEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> product_id <br class="atl-forced-newline" /> </td>
<td> ID of the product <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string </td>
<td> sku <br class="atl-forced-newline" /> </td>
<td> SKU of the product <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> double </td>
<td> qty <br class="atl-forced-newline" /> </td>
<td> Number of products <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> associativeArray <br class="atl-forced-newline" /> </td>
<td> options <br class="atl-forced-newline" /> </td>
<td> An array of options </td>
</tr>
<tr>
<td> associativeArray <br class="atl-forced-newline" /> </td>
<td> bundle_option <br class="atl-forced-newline" /> </td>
<td> An array of bundle item options <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> associativeArray <br class="atl-forced-newline" /> </td>
<td> bundle_option_qty <br class="atl-forced-newline" /> </td>
<td> An array of bundle items quantity <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> ArrayOfString </td>
<td> links <br class="atl-forced-newline" /> </td>
<td> An array of links <br class="atl-forced-newline" /> </td>
</tr>
</tbody></table>


<p>The <b>giftMessageEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> from <br class="atl-forced-newline" /> </td>
<td> Gift message sender </td>
</tr>
<tr>
<td> string </td>
<td> to <br class="atl-forced-newline" /> </td>
<td> Gift message recipient </td>
</tr>
<tr>
<td> string </td>
<td> message <br class="atl-forced-newline" /> </td>
<td> Gift message </td>
</tr>
</tbody></table>

<p><b>Faults:</b><br/>
<em>No Faults.</em></p>

<h4><a name="giftmessage.setForQuoteProduct-Examples"></a>Examples</h4>

<h5><a name="giftmessage.setForQuoteProduct-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
 
$result = $proxy-&gt;call($sessionId, 'giftmessage.setForQuoteProduct', array(10, array(
'product' =&gt; array(
 'product_id' =&gt; '5',
 'sku' =&gt; 'sku',
 'qty' =&gt; '1',
 'options' =&gt; null,
 'bundle_option' =&gt; null,
 'bundle_option_qty' =&gt; null,
 'links' =&gt; null), 
'message' =&gt; array(
 'from' =&gt; 'Sara', 'to' =&gt; 'John', 'message' =&gt; 'Gift message text')
)));
 
 
var_dump($result);</pre>
		</div>
</div></div>



<h5><a name="giftmessage.setForQuoteProduct-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); 
 
$result = $proxy-&gt;giftMessageSetForQuoteProduct($sessionId, '10', array(array(
'product' =&gt; array(
 'product_id' =&gt; '5',
 'sku' =&gt; 'sku',
 'qty' =&gt; '1',
 'options' =&gt; null,
 'bundle_option' =&gt; null,
 'bundle_option_qty' =&gt; null,
 'links' =&gt; null), 
'message' =&gt; array(
 'from' =&gt; 'Sara', 'to' =&gt; 'John', 'message' =&gt; 'Gift message text')
)));
 
var_dump($result);</pre>
		</div>
</div></div>





<h5><a name="giftmessage.setForQuoteProduct-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;giftMessageSetForQuoteProduct((object)array('sessionId' =&gt; $sessionId-&gt;result, 'quoteId' =&gt; '10', 'productsAndMessages' =&gt; array(array(
'product' =&gt; array(
 'product_id' =&gt; '5',
 'sku' =&gt; 'sku',
 'qty' =&gt; '1',
 'options' =&gt; null,
 'bundle_option' =&gt; null,
 'bundle_option_qty' =&gt; null,
 'links' =&gt; null), 
'message' =&gt; array(
 'from' =&gt; 'Sara', 'to' =&gt; 'John', 'message' =&gt; 'Gift message text')
))));
 
var_dump($result-&gt;result);</pre>
		</div>
</div></div>



